// KULoket Printer 
// Resource: print_override.js
// Version: 1.0
// Author: Pieter Laenen

/*
 * Restores the original window.print() function.
 */

function print(){
	resetNativePrint();
	console.log("Resetting window.print() to native implementation");
	window.print();
}

/**
 * Retrieve the native implementation of the given function from an ad hoc iframe.
 * @param native the method name
 * @returns the native implementation of the requested window function.
 */
function resetNativePrint() {
	  var iframe = document.createElement('iframe');
	  document.body.appendChild(iframe);
	  window.print = iframe.contentWindow['print'];
	  document.body.removeChild(iframe);
}